const instance = axios.create({
    baseURL: process.env.BASE_API, // node环境的不同，对应不同的baseURL
    withCredentials: true // 允许携带cookie
});
instance.interceptors.response.use(res => res.data);
export default function (type, url, data, options) {
    if (type === "get") {
        return instance.get(url, {
            params: data
        })

    } else {
        if (options) {

            return instance.post(url, data)

        } else {

            return instance.post(url, data, options)
        }
    }
}